package com.bj58.groupbuy.action.service;

import java.util.List;

import com.bj58.groupbuy.action.model.DBHostPwd;
import com.bj58.groupbuy.action.model.DBPriviledge;
import com.bj58.groupbuy.action.model.DBUser;
import com.bj58.groupbuy.wf.page.Paginate;

public interface DBService {

	public List<DBHostPwd> getAllHost() throws Exception;
	
	public DBUser getUserByName(String username) throws Exception;
	
	public boolean saveUser(DBUser user) throws Exception;
	
	public boolean deleteUser(String username);
	
	public DBHostPwd getHostPwd(String hostname) throws Exception;
	
	public List<DBPriviledge> getDBPriByUname(String username) throws Exception;
	
	public DBPriviledge getDBPri(String username,String hostname,String database,String tablename) throws Exception;
	
	public boolean delDBPriByUname(String username) throws Exception;

	public List<String> getDBNames(String hostname);
	
	public List<String> getTableNames(String hostname,String dbname);

	public boolean saveDBPriv(String username, String password, String hostname,
			String dbname, String tablenames, String priviledges) throws Exception;

	boolean delDBPriv(String username, String hostname, String dbname,
			String tableName, String priviledges) throws Exception;

	
	//更新权限
	public boolean updateDBPri(String username,String password, String hostname, String dbname,
			String tablename, String priv) throws Exception;

	public Paginate<DBPriviledge> getDBPrivByPage(int pageIndex, int pageSize,
			String condition) throws Exception;
}
